package com.yidu.drug.service.impl;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yidu.drug.common.Message;
import com.yidu.drug.dao.QtSumModelMapper;
import com.yidu.drug.dao.QualityTestingModelMapper;
import com.yidu.drug.dao.RepertoryModelMapper;
import com.yidu.drug.model.InventoryModel;
import com.yidu.drug.model.QtSumModel;
import com.yidu.drug.model.QualityTestingModel;
import com.yidu.drug.model.RepertoryModel;
import com.yidu.drug.service.QtSumModelService;

@Service
public class QtSumModelServicelmpl implements QtSumModelService{

	@Resource
	private QtSumModelMapper qtSumModelDao;
	
	Message msg = new Message();
	
	@Resource
	private RepertoryModelMapper repertoryModelDao;
	
	@Override
	public int deleteByPrimaryKey(String sumId) {
		// TODO Auto-generated method stub
		return qtSumModelDao.deleteByPrimaryKey(sumId);
	}

	@Override
	public int insert(QtSumModel record) {
		// TODO Auto-generated method stub
		return qtSumModelDao.insert(record);
	}

	@Override
	public int insertSelective(QtSumModel record) {
		// TODO Auto-generated method stub
		return qtSumModelDao.insertSelective(record);
	}

	@Override
	public QtSumModel selectByPrimaryKey(String sumId) {
		// TODO Auto-generated method stub
		return qtSumModelDao.selectByPrimaryKey(sumId);
	}

	@Override
	public int updateByPrimaryKeySelective(QtSumModel record) {
		// TODO Auto-generated method stub
		return qtSumModelDao.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(QtSumModel record) {
		// TODO Auto-generated method stub
		return qtSumModelDao.updateByPrimaryKey(record);
	}

	@Override
	public Long findRows(QtSumModel record) {
		// TODO Auto-generated method stub
		return qtSumModelDao.findRows(record);
	}

	@Override
	public List<QtSumModel> findAllQtSumModel(QtSumModel record) {
		// TODO Auto-generated method stub
		return qtSumModelDao.findAllQtSumModel(record);
	}

	@Override
	public QtSumModel findById(String sumId) {
		// TODO Auto-generated method stub
		return qtSumModelDao.findById(sumId);
	}

	@Override
	public int save(QtSumModel qtSumModel) {
		System.out.println("进来了-=-=-=-=-=-=-=-=-=-=-=-=");
		
		String sumId = UUID.randomUUID().toString().replaceAll("-", "");
		
		Timestamp t = new Timestamp(new Date().getTime());
		qtSumModel.setSumId(sumId);
		
		int rows = qtSumModelDao.insert(qtSumModel);
		return rows;
	}

	
	

	

	
}
